#! /bin/sh

#
# Check invalid VTOP translation for AArch64 with 4k pages.
#

pf="aarch64:12,9,9,9,9"

ptes="-e 0x0000:0x1003"		# P4D[0] -> 1000
ptes="$ptes -e 0x0008:0x5000"	# P4D[1] -> INVALID
ptes="$ptes -e 0x0010:0x60000000001"	# P4D[1] -> BLOCK (not allowed here)
ptes="$ptes -e 0x1000:0x2003"	# P4D[0] -> PUD[0] -> 2000
ptes="$ptes -e 0x1010:0x3c0000790" # P4D[0] -> PUD[2] -> INVALID
ptes="$ptes -e 0x2000:0x3003"	# P4D[0] -> PUD[0] -> PMD[0] -> 3000
ptes="$ptes -e 0x2010:0xe00790"	# P4D[0] -> PUD[0] -> PMD[2] -> INVALID
ptes="$ptes -e 0x3000:0xa792"	# P4D[0] -> PUD[0] -> PMD[0] -> PTE[0] -> INVALID
ptes="$ptes -e 0x3008:0xb791"	# P4D[0] -> PUD[0] -> PMD[0] -> PTE[1] -> RESERVED

list="0x123"			# P4D[0] -> PUD[0] -> PMD[0] -> PTE[0]
list="$list 0x1234"		# P4D[0] -> PUD[0] -> PMD[0] -> PTE[1]
list="$list 0x523456"		# P4D[0] -> PUD[0] -> PMD[2]
list="$list 0xa1234567"		# P4D[0] -> PUD[2]
list="$list 0x808060489a"	# P4D[1]
list="$list 0x1008060489a"	# P4D[2]

. "$srcdir"/addrxlat-invalid
